Skip to content

Learning page shows whether each loop still learns; run page shows a held draft and a GitHub wait - #332

Merged
nambok merged 2 commits into
mainfrom
learning-health-and-draft-hold
Nov 7, 2026
Merged

nambok merged 2 commits into
mainfrom
learning-health-and-draft-hold

Conversation

@nambok

@nambok nambok commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The dashboard shows three new API fields from the platform:

Changes

  • src/lib/api.ts: adds RunDraftHold, RunDraftHoldReason, draft_hold and github_wait on RunDetail, the LearningHealth and LearningLoop types, and api.getLearningHealth().
  • src/app/learning/health.tsx (new), placed under the Learning page header as a Section (#health):
    • Each card has the loop's label and a status pill: Learning, Nothing to learn from yet, or Not learning.
    • Each card also says, in plain words, what the loop learns from (all nine gateway keys are covered), when it last learned (or "never"), "N of M this week", and the gateway's detail line.
    • A quiet loop gets a red card with "What to check", and quiet loops are listed first. If any loop is quiet, an error callout at the top gives the count.
    • The section loads separately from the rest of the page. If the load fails, it shows a retry. On a 404 (an older gateway without the route), the section is hidden.
  • src/app/runs/detail/page.tsx:
    • draft_hold is shown on needs_input, completed or success runs. It takes the outcome card's place at the top, ahead of the named wait for the same pull request.
    • Kind held uses the waiting tone. waiting also uses the waiting tone, with the title "Finished, PR held until a check settles". failed uses the attention tone, with the title "Finished, PR held: GitHub refused to mark it ready".
    • The card lists each reason with "What to do", plus "Held since". Actions are Open pull request and Retry.
    • github_wait is shown only while the run is live (pending, queued, running, awaiting_ci). A finished run ignores a stale value.
  • src/components/run-status.tsx: RunStatusBadge takes draftHold and reads "Finished, PR held". It uses the attention tone when GitHub refused to mark the pull request ready.
  • src/lib/openapi-fields.ts and src/lib/api-contract.ts:
  • e2e:
    • e2e/run-draft-hold.spec.ts (new) covers:
      • a held run
      • GitHub refusing to mark the pull request ready
      • no hold, which reads as before
      • a GitHub wait
      • a stale GitHub wait on a finished run
      • 375 px width for both the hold and the wait
    • e2e/learning.spec.ts adds:
      • a red loop with what to check, next to an idle loop and working loops
      • all loops learning
      • a failed health check with a retry
      • an older gateway with no section
      • 375 px width
    • e2e/wide-data answers /api/learning/health and adds draft_hold and github_wait with long strings to the wide run. The no-sideways-scroll, readable-text and no-mid-word-breaks specs now cover both.

Verification

All of these ran in dashboard/:

  • npm ci: passed.
  • npm run lint: UI lint passed, no hardcoded hosted addresses.
  • npm run typecheck: clean.
  • npm run check:openapi: matches coderhelm-platform@de34e9c1 (main).
  • npm run build: passed, with NEXT_PUBLIC_API_URL pointed at the e2e server the way CI sets it.
  • Full Playwright suite on the static build (E2E_STATIC=1), run the way CI runs it: 1425 passed, 0 failed, 10 skipped.
  • e2e/learning.spec.ts and e2e/run-draft-hold.spec.ts on their own: 30 passed.
  • No sideways scroll at 375 px on the run page (hold and GitHub wait) or on the Learning page with a red loop. The route-wide no-sideways-scroll spec passes at 375 and 390 px.

…raft and a GitHub wait show on the run page

The Learning page opens with one card per learning loop (GET /api/learning/health):
what it learns from, when it last learned, its count this week against what should
have fed it, and for a loop that went quiet, a red state with what to check.

A finished run whose pull request stays a draft (draft_hold) reads "Finished, PR held"
in its status and at the top of the run page, with the summary and each reason with
what to do. A working run waiting out GitHub's hourly limit (github_wait) says when it
goes on and that nothing is needed.

The API field list is regenerated at the platform commit that adds draft_hold.
…at platform main

Each learning loop's title comes from its id in plain words, Coderhelm spelling, and
the API's name strings are never shown. An id the dashboard doesn't know reads as its
words. The test data follows the platform's same-unit counts (pull requests on both
sides), so no loop reads more than it should have had.

src/lib/openapi-fields.ts is regenerated at coderhelm-platform main now that the
draft hold has merged.
@nambok
nambok merged commit 9ed1aa2 into main Nov 7, 2026
10 checks passed
@nambok
nambok deleted the learning-health-and-draft-hold branch November 7, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant